package com.tengju.bff.interfaces.covercharge.intf;

import com.idanchuang.component.base.JsonResult;
import com.tengju.bff.interfaces.covercharge.dto.SignContractInfo;
import com.tengju.bff.interfaces.covercharge.dto.SignContractQuery;
import com.tengju.bff.interfaces.covercharge.dto.SignSucContractInfo;
import com.tengju.bff.interfaces.covercharge.dto.SignSucContractQuery;
import com.tengju.bff.interfaces.shared.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;


/**
 * @author liang_shi
 * @date 2020/7/27 21:27
 * @description 服务合同服务
// */
//@Api(value = "/api/contract", tags = "服务合同服务")
//@FeignClient(value = "covercharge-service")
public interface IContractProvider {

    /**
     * 查询签署合同
     *
     * @param query 查询对象
     * @return 结果
     */
    @ApiOperation(value = "查询用户签署的合同", notes = "查询用户签署的合同")
    @RequestMapping(value = "/querySignContract", method = RequestMethod.POST)
    ApiResponse<List<SignContractInfo>> querySignContract(@RequestBody SignContractQuery query);

    /**
     * 查询用户签署成功的合同
     *
     * @param query 查询对象
     * @return 结果
     */
    @ApiOperation(value = "查询用户签署成功的合同", notes = "查询用户签署成功的合同")
    @RequestMapping(value = "/querySucSignContract", method = RequestMethod.POST)
    ApiResponse<SignSucContractInfo> querySucSignContract(@RequestBody SignSucContractQuery query);

    /**
     * 获取合同预览地址
     *
     * @param account 用户
     * @param contractId 合同Id
     * @return 预览地址
     */
    @ApiOperation(value = "获取合同预览地址", notes = "获取合同预览地址")
    @RequestMapping(value = "/queryContractPreviewUrl/{account}/{contractId}", method = RequestMethod.POST)
    ApiResponse<String> queryContractPreviewUrl(@PathVariable("account") String account, @PathVariable("contractId") String contractId);

    /**
     * 下载合同
     *
     * @param contractId 合同Id
     * @return 预览地址
     */
    @ApiOperation(value = "下载合同", notes = "下载合同")
    @RequestMapping(value = "/download/{contractId}", method = RequestMethod.POST)
    ApiResponse<byte[]> download(@PathVariable("contractId") String contractId);

}
